import request from '@/utils/request'

// 查询列表
export function archiveList(query) {
    return request({
        url: '/businessWorkbench/archive/list',
        method: 'get',
        params: query
    })
}

//获取所有附件
export function listAttachments(query) {
    return request({
        url: '/businessWorkbench/archive/listAttachments',
        method: 'get',
        params: query
    })
}

// 查询列表
export function archiveListInDoc(query) {
    return request({
        url: '/businessWorkbench/archive/listInDoc',
        method: 'get',
        params: query
    })
}

// 新增
export function addarchive(data) {
    return request({
        url: '/businessWorkbench/archive',
        method: 'post',
        data: data
    })
}

// 删除
export function delarchive(ids) {
    return request({
        url: '/businessWorkbench/archive/' + ids,
        method: 'delete'
    })
}

// 导出
export function exportArchive(query) {
    return request({
        url: '/businessWorkbench/archive/export',
        method: 'get',
        params: query
    })
}

// 详情
export function archiveInfo(id) {
    return request({
        url: '/businessWorkbench/archive/' + id,
        method: 'get'
    })
}

// 详情
export function archiveUpdate(data) {
    return request({
        url: '/businessWorkbench/archive',
        method: 'put',
        data: data
    })
}

// 点击收资管理
export function archiveGetpickup(id) {
    return request({
        url: '/businessWorkbench/pickup/getPickups/' + id,
        method: 'get'
    })
}

// 点击文档目录
export function archiveGetDoc(id) {
    return request({
        url: '/businessWorkbench/doc/getDocByCatalogId/' + id,
        method: 'get'
    })
}

// 点击目录获取附件
export function archiveGetfiles(id) {
    return request({
        url: '/businessWorkbench/archive/getAttachments/' + id,
        method: 'get'
    })
}

export function getArchiveAllStatus(id) {
    return request({
        url: '/businessWorkbench/archive/getArchiveAllStatus/' + id,
        method: 'get'
    })
}

export function getDocArchiveByBusinessId(businessId) {
    return request({
        url: '/businessWorkbench/archive/getDocArchiveByBusinessId/' + businessId,
        method: 'get'
    })
}

export function getReports(businessId) {
    return request({
        url: '/businessWorkbench/archive/getReports/' + businessId,
        method: 'get'
    })
}